import path from "path";
import { defineConfig } from "vite";
import { fileURLToPath } from "url";
import react from "@vitejs/plugin-react";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const projectDir = path.join(__dirname, "..");
const electronDir = path.join(projectDir, "electron");
const electronWebDir = path.join(electronDir, "src", "web");

// https://vitejs.dev/config/
export default defineConfig({
  base: "./",
  build: {
    outDir: electronWebDir,
  },
  plugins: [react()],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
});
